<?php

defined('BY_JYA') or exit('error');
list($message)=$arguments;
$setting=$this->plugin_setting('api');
if(!$setting['api_key']){
	return error('接口参数错误！');
}
$api_url="http://ai.jinyunweb.com/api/robot.php?apikey={$setting['api_key']}&question={$message}";
$res=cfc('http')->ihttp_get($api_url);
if(is_error($res)){
	return $res;
}
$res=$res['content'];
$res=json_decode($res,true);
if($res['type']=='success'){
	return $res['message'];
}else{
	return error($res['message']);
}
